<!DOCTYPE html>
<html>
<head>
    <title>订单表</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.customerName" @on-enter="query" placeholder="客户名称"/>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.productName" @on-enter="query" placeholder="产品名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                <!--  #if($shiro.hasPermission("order:save"))
                  <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                  #end-->
                #if($shiro.hasPermission("order:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("order:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <div>
            <p slot="title">{{title}}&nbsp;&nbsp;<i-button v-show="show.orderDetails" type="info"
                                                           @click="downloadContract"><i class="fa"></i>&nbsp;合同下载
            </i-button>
            </p>
        </div>
        <i-form ref="formValidate" :model="order" :rules="ruleValidate" :label-width="80">
            <div v-show="show.updateDiv">
                <row :gutter="24">
                    <i-col span="6">
                        <Form-item label="申请编号" prop="applyNo">
                            <i-input v-model="order.applyNo" placeholder="申请编号"/>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="业务员" prop="promoUserId">
                            <i-select v-model="order.promoUserId" filterable>
                                <i-option v-for="item in options.agentList" :value="item.value" :key="item.value">{{
                                    item.label
                                    }}
                                </i-option>
                            </i-select>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="产品" prop="productId">
                            <i-select v-model="order.productId" filterable>
                                <i-option v-for="item in options.productList" :value="item.value" :key="item.value">{{
                                    item.label
                                    }}
                                </i-option>
                            </i-select>
                        </Form-item>
                    </i-col>
                </row>
                <row :gutter="24">
                    <i-col span="6">
                        <Form-item label="贷款额度" prop="loanQuota">
                            <i-input v-model="order.loanQuota" placeholder="贷款额度"/>
                            <span slot="append">万元</span>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="贷款年限" prop="loanYears">
                            <i-input v-model="order.loanYears" placeholder="贷款年限"/>
                            <span slot="append">年</span>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="贷款利率" prop="loanRate">
                            <i-input v-model="order.loanRate" placeholder="贷款利率"/>
                            <span slot="append">%</span>
                        </Form-item>
                    </i-col>
                </row>
                <row :gutter="32">
                    <i-col span="6">
                        <Form-item label="订单状态" prop="orderStatus">
                            <i-select v-model="order.orderStatus">
                                <i-option :value="10">订单已提交</i-option>
                                <i-option :value="20">贷款申请中</i-option>
                                <i-option :value="30">贷款成功</i-option>
                                <i-option :value="40">贷款失败</i-option>
                            </i-select>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="最后跟进时间" prop="loanLastFollowAt">
                            <date-picker v-model="order.loanLastFollowAt" type="date" placeholder="请选择时间"
                                         style="width: 200px"></date-picker>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="贷款提交时间" prop="loanSubmitAt">
                            <date-picker v-model="order.loanSubmitAt" type="date" placeholder="请选择时间"
                                         style="width: 200px"></date-picker>
                        </form-item>
                    </i-col>
                </row>
                <row :gutter="24">
                    <i-col span="6">
                        <form-item label="贷款申请时间" prop="loanApplyAt">
                            <date-picker v-model="order.loanApplyAt" type="date" placeholder="请选择时间"
                                         style="width: 200px"></date-picker>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="贷款成功时间" prop="loanSuccessAt">
                            <date-picker v-model="order.loanSuccessAt" type="date" placeholder="请选择时间"
                                         style="width: 200px"></date-picker>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="贷款失败时间" prop="loanFailAt">
                            <date-picker v-model="order.loanFailAt" type="date" placeholder="请选择时间"
                                         style="width: 200px"></date-picker>
                        </form-item>
                    </i-col>
                </row>
                <row :gutter="24">
                    <i-col span="6">
                        <form-item label="创建时间" prop="createAt">
                            <date-picker v-model="order.createAt" type="date" placeholder="请选择时间"
                                         style="width: 200px"></date-picker>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="更新时间" prop="updateAt">
                            <date-picker v-model="order.updateAt" type="date" placeholder="请选择时间"
                                         style="width: 200px"></date-picker>
                        </form-item>
                    </i-col>
                </row>
            </div>


            <div v-show="show.orderDetails" v-if="order != null">
                <div style="font-size: 16px;font-weight: bold;" class="info-part-title">订单详情</div>
                <row :gutter="24">
                    <i-col span="6">
                        <form-item label="客户姓名">
                            <i-input v-model="order.customerName"/>
                        </form-item>
                    </i-col>

                    <i-col span="6">
                        <form-item label="联系方式">
                            <i-input v-model="order.customerMobile"/>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <Form-item label="产品名称">
                            <i-input v-model="order.productName"/>
                        </Form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="银行" prop="bankName">
                            <i-input v-model="order.bankName"/>
                        </form-item>
                    </i-col>
                </row>
                <row :gutter="24">
                    <i-col span="6">
                        <form-item label="贷款类型" prop="applyType">
                            <i-select disabled = "disabled" v-model="order.applyType" filterable>
                                <i-option v-for="item in options.applyTypeArr" :value="item.value" :key="item.value">{{
                                    item.label
                                    }}
                                </i-option>
                            </i-select>
                        </form-item>
                    </i-col>

                    <i-col span="6">
                        <form-item label="贷款额度">
                            <i-input v-model="order.loanQuota"/>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="贷款期限">
                            <i-input v-model="order.loanYears"/>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="贷款利率">
                            <i-input v-model="order.loanRate"/>
                            <span slot="append">%</span>
                        </form-item>
                    </i-col>
                </row>
            </div>
            <div v-show="show.freeDetail" v-if="order.orderContract != null">
                <div style="font-size: 16px;font-weight: bold;" class="info-part-title">费用明细</div>
                <row :gutter="24">
                    <i-col span="6">
                        <form-item label="服务费">
                            <i-input v-model="order.orderContract.serviceFee"/>
                            <span slot="append">元</span>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="担保费">
                            <i-input v-model="order.orderContract.guaranteeFee"/>
                            <span slot="append">元</span>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="账户管理费">
                            <i-input v-model="order.orderContract.accountManagementFee"/>
                            <span slot="append">元</span>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="风险保证金">
                            <i-input v-model="order.orderContract.riskGuaranteeFee"/>
                            <span slot="append">元</span>
                        </form-item>
                    </i-col>
                </row>
                <row :gutter="24">
                    <i-col span="6">
                        <form-item label="渠道代理费">
                            <i-input v-model="order.orderContract.channelAgentFee"/>
                            <span slot="append">元</span>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="发票费">
                            <i-input v-model="order.orderContract.invoiceRate"/>
                            <span slot="append">%</span>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="资料费">
                            <i-input v-model="order.orderContract.informationFee"/>
                            <span slot="append">元</span>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="垫资费">
                            <i-input v-model="order.orderContract.advanceFee"/>
                            <span slot="append">元</span>
                        </form-item>
                    </i-col>
                </row>
                <row :gutter="24">
                    <i-col span="6">
                        <form-item label="预付金">
                            <i-input v-model="order.orderContract.prepaymentFee"/>
                            <span slot="append">元</span>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="抵押登记查询费">
                            <i-input v-model="order.orderContract.mortgageRegistrationQueryFee"/>
                            <span slot="append">元/笔</span>
                        </form-item>
                    </i-col>
                    <i-col span="6">
                        <form-item label="抵押加急费">
                            <i-input v-model="order.orderContract.mortgageEmergencyFee"/>
                            <span slot="append">元/笔</span>
                        </form-item>
                    </i-col>
                </row>
            </div>
            <div v-show="show.chargeWay" v-if="order.orderContract != null">
                <div style="font-size: 16px;font-weight: bold;" class="info-part-title">收取方式</div>
                <row :gutter="24">
                    <i-col span="6">
                        <form-item label="预付定金">
                            <i-input v-model="order.orderContract.receiveAdvanceMoney"/>
                            <span slot="append">元</span>
                        </form-item>
                    </i-col>
                </row>
            </div>
            <div v-show="show.progressInformation" v-if="order.orderFollowList != null">
                <div style="font-size: 16px;font-weight: bold;" class="info-part-title">进度信息</div>
                <table id="progress">
                    <row :gutter="24">
                        <tr>
                            <td align="right"><i-col span="38"><form-item><span style="font-size: 14px; font-weight: bold">进度环节</span></form-item></i-col></td>
                            <td align="right"><i-col span="38"><form-item><span style="font-size: 14px; font-weight: bold">完成时间</span></form-item></i-col></td>
                            <td align="right"><i-col span="38"><form-item><span style="font-size: 14px; font-weight: bold">说明</span></form-item></i-col></td>
                            <td align="right"><i-col span="38"><form-item><span style="font-size: 14px; font-weight: bold">操作人</span></form-item></i-col></td>
                            <td align="right"><i-col span="38"><form-item><span style="font-size: 14px; font-weight: bold">操作时间</span></form-item></i-col></td>
                        </tr>
                        <tr v-for="follow in order.orderFollowList">
                            <td><i-col span="38"><form-item>
                                <i-select disabled = "disabled" v-model="follow.orderStatus" filterable>
                                <i-option :value="10">订单已提交</i-option>
                                <i-option :value="20">贷款申请中</i-option>
                                <i-option :value="30">贷款成功</i-option>
                                <i-option :value="40">贷款失败</i-option>
                            </i-select></form-item></i-col></td>
                            <td align="left"><i-col span="38"><form-item>{{follow.completeAt}}</form-item></i-col></td>
                            <td align="left"><i-col span="38"><form-item>{{follow.remark}}</form-item></i-col></td>
                            <td align="left"><i-col span="38"><form-item>
                                <i-select disabled = "disabled" v-model="follow.promoUserId" filterable>
                                    <i-option v-for="item in options.agentList" :value="item.value" :key="item.value">{{item.label}}</i-option>
                                </i-select>
                            </form-item></i-col></td>
                            <td align="left"><i-col span="38"><form-item>{{follow.createAt}}</form-item></i-col></td>
                        </tr>
                    </row>
                </table>
            </div>
            <Form-item>
                <i-button type="primary" v-show="show.updateDiv" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">返回</i-button>
                <i-button type="ghost" v-show="show.updateDiv" @click="handleReset('formValidate')"
                          style="margin-left: 8px">重置
                </i-button>
            </Form-item>
        </i-form>
    </Card>

</div>

<script src="${rc.contextPath}/js/lht/order.js?r=_${date.systemTime}"></script>
</body>
</html>